package org.example.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.example.entity.ExamEntity;
import org.example.service.AutoGradeService;
import org.example.service.ExamTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@RestController
@RequestMapping("/exam")

public class ExamResController {
    @Autowired
    private AutoGradeService autoGradeService;

    @Autowired
    private ExamTypeService examTypeService;
    @PostMapping("/list")
    public IPage list(@RequestParam Map<String, Object> params) {
        IPage<ExamEntity> page = examTypeService.queryPage(params);
        return page;
    }


        @PostMapping("/grade")
        public float autoGradeExam(@RequestParam int examId, @RequestParam int studentId) {
            // 调用Service层的自动评分方法
             return autoGradeService.autoGradeExam(examId, studentId);

        }
}




